<% layout('/layouts/default.html', {title: '订单列表【租】', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('订单列表【租】')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
			
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${ztOrder}" action="${ctx}/ztXJOrder/listData" method="post" class="form-inline hide"

					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">

				<div class="form-group">
					<label class="control-label">${text('订单号')}：</label>
					<div class="control-inline">
						<#form:input path="order" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				
				<div class="form-group">
					<label class="control-label">${text('小程序用户名')}：</label>
					<div class="control-inline">
						<#form:input path="ztAdmin.name" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				
				<div class="form-group">

					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>

					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>

				</div>

			</#form:form>

			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>

// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [     
	          
	        	
		{header:'${text('订单号')}', name:'order',index:'a.order',  width:150, align:"center"},
		
		{header:'${text('小程序用户名')}', name:'ztAdmin.name',index:'u10.name',  width:150, align:"center"},
		
		{header:'${text('收货人')}', name:'name', index:'a.name', width:150, align:"center"},
		
		{header:'${text('号码')}', name:'phone', index:'a.phone', width:100, align:"center"},
		
		{header:'${text('租金')}', name:'origPrice', index:'a.origPrice', width:100, align:"center", formatter: function(val, obj, row, act){
				
			return (val-row.deposit);
		}},
		
		{header:'${text('押金')}', name:'deposit', index:'a.deposit', width:100, align:"center"},
		
		
		
		{header:'${text('原价')}', name:'origPrice', index:'a.origPrice', width:90, align:"center"},
		{header:'${text('优惠')}', name:'quanselfid', index:'a.quanselfid', width:130, align:"center"},
		{header:'${text('实际总价')}', name:'totalPrice', index:'a.totalPrice', width:90, align:"center"},
		
		
		{header:'${text('租期(月)')}', name:'count', index:'a.count', width:100, align:"center"},
		{header:'${text('剩余时间')}', name:'sysj', index:'a.sysj', width:100, align:"center"},
		
		
		{header:'${text('下单时间')}', name:'orderTime', index:'a.order_time', width:190, align:"center"},
		{header:'${text('付款时间')}', name:'payTime', index:'a.pay_time', width:190, align:"center"},
		{header:'${text('状态')}', name:'orderstatus', index:'a.orderstatus', width:100, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_rentstatus_type')}, val, '${text('待付款')}', true);
		}},
		
		
		{header:'${text('操作')}', name:'actions', width:100,align:"center", sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('ztOrder:ztOrderData:edit')){ %>
				
				actions.push('<a href="${ctx}/ztXJOrder/form?id='+row.id+'" class="btnList" title="${text('查看订单详情')}"><i class="fa fa-navicon"></i></a>&nbsp;');

			<% } %>
			return actions.join('');
		}}
		
		
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>